package com.jz.util;


/**
 * Created by WISE on 2021/12/26.
 */
//统一返回值
public class ResultBuildVo<T> {

    public  static<T>  ResultVo success(T data){
        ResultVo resultVo = new ResultVo();
        resultVo.setSuccess(true);
        resultVo.setData(data);

        return resultVo;
    }

    public static<T> ResultVo success(){
        ResultVo resultVo = new ResultVo();
        resultVo.setSuccess(true);
        resultVo.setData(null);
        return resultVo;
    }

    public  static<T>  ResultVo error(String message){
        ResultVo resultVo = new ResultVo();
        resultVo.setSuccess(false);
        resultVo.setErrorMessage(message);

        return resultVo;
    }


}
